<template>
  <el-table
    :data="tableData"
    border
    height="400px"
    max-height="400px"
    size="small"
    row-class-name="row"
    cell-class-name="column"
    :highlight-current-row="true"
    fit>
    <el-table-column
      v-for="(item, index) in tableLabel"
      :key="index"
      :prop="item.prop"
      :width="item.width"
      :label="item.label">
      <template slot-scope="scope">
        <el-button
          v-if="item.isOpera"
          type="text"
          size="small"
          @click="handleGoods(scope.row)">{{ scope.row[item.prop] }}</el-button>
        <div v-else>{{ scope.row[item.prop] }}</div>
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
export default {
  props: {
    tableData: {
      type: Array,
      default: () => {
        return []
      }
    },
    tableLabel: {
      type: Array,
      default: () => {
        return []
      }
    }
  }
}
</script>

